Skip to content

Log condition report for child management context#50378

Closed
zxuhan wants to merge 1 commit into
spring-projects:mainfrom
zxuhan:gh-6698-log-child-context-conditions
Closed

Log condition report for child management context#50378
zxuhan wants to merge 1 commit into
spring-projects:mainfrom
zxuhan:gh-6698-log-child-context-conditions

Conversation

@zxuhan

@zxuhan zxuhan commented May 8, 2026

Copy link
Copy Markdown
Contributor

When management.server.port differs from server.port, Spring Boot creates a child management context with its own conditions. The ConditionEvaluationReportLoggingListener registered via spring.factories only attaches to the parent context, so the child's conditions are absent from the report logged at startup.

This change registers a ConditionEvaluationReportLoggingListener on the management context as part of ChildManagementContextInitializer.createManagementContext, so the child's conditions are logged alongside the parent's.

See gh-6698

Register a ConditionEvaluationReportLoggingListener on the management
context created when management.server.port differs from server.port.
Without this, conditions evaluated in the child context are absent from
the auto-configuration report logged at startup.

See spring-projectsgh-6698

Signed-off-by: zxuhan7 <zxuhan7@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 8, 2026
@wilkinsona

Copy link
Copy Markdown
Member

Unfortunately, this doesn't feel like the right approach as I don't think the code that creates the management context should know about the ConditionEvaluationReportLoggingListener. An alternative could be to apply all initialisers registered in spring.factories but I'm not sure that's right either. I think #6698 probably needs some design work before we can proceed and I will update its labels to that effect. Thanks anyway for the PR.

@wilkinsona wilkinsona closed this Jun 28, 2026
@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants